package com.qinker.oa.dao;

import com.qinker.oa.model.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserDao {


    @Insert("insert into user(nickname, password) values(#{nickname},#{password})")
    void insert(User user);

    @Select("select id,user_name as username,nickname,role from user_t where user_name=#{username} and password=#{password}")
    User login(User user);

    @Select("select id from user_t where nickname like #{nickname}")
    int[] getUserByName(String nickname);
}
